This invention relates generally to storage subsystems for computer systems. In particular, this invention relates to methods for preventing data from being written to the same physical location on a storage medium that a non-recoverable read error occurred previously.
Maximizing the reliability of the data in disk drives is a key objective of disk drive designers. If an error occurs during a read operation, the offending section of data can be re-read or re-written to. It is realized that permanent disk damages could occur and the data will still be bad even after further re-write processes. It then becomes desirable to flag the physical area on the disk as bad and use the available spare sectors (a process called reallocation). Reallocation is used to move the data on the bad sector to another sector. If the data on the bad sector is not recovered, reallocation does not occur. Moreover, the prior art does not permanently prevent later re-use of the previously flagged bad physical location on the disk. Accordingly, there is a possibility of a non-recoverable read error of newly written data occurring at the same physical location that a non-recoverable read error of old data occurred previously.
Thus, there is a need for a system and method to detect non-recoverable read errors on a magnetic disk and to prevent future writing to the bad sectors, thereby eliminating the possibility that a non-recoverable read error will occur in the same physical location that a non-recoverable read error occurred previously.
The present invention is directed to a method for preventing data from being written to a data sector that has been identified as faulty on a disk in a disk drive system. It is first determined whether data of a data sector of a portion of a disk is recoverable. If the data is non-recoverable, an invalid logical ID is written to the logical block address (LBA) corresponding to the data sector thereby identifying the data sector as faulty and preventing data from being written at the data sector. If new data is written, the LBA is then reallocated to point to a different data sector if the data is non-recoverable. Thus, further data directed to the LBA will be written to the different data sector responsive to the reallocated LBA, thereby avoiding writing the new data to the data sector identified as faulty. Internal drive read re-tries can still take place on the faulty data sector even after the LBA has been assigned an invalid logical ID.
According to aspects of the invention, the data of the data sector is determined to be recoverable or not by reading the data sector responsive to at least one of a host ordered read and an internal drive read re-try.
Preferably, a predetermined number of internal drive re-tries occurs if a host ordered read is unsuccessful.
According to another aspect of the invention, an error condition is generated if the data is non-recoverable.
Another exemplary method of preventing writing data to a faulty data sector comprises receiving a request to write data to an LBA; determining if the LBA corresponds to a faulty data sector; reallocating the LBA to a new data sector if the LBA corresponds to the faulty data sector; and writing the data to the new data sector responsive to the reallocation.
According to aspects of the invention, determining if the LBA corresponds to a faulty data sector comprises checking the LBA for an invalid logical ID.
An exemplary method of reading data on a disk in accordance with the present invention comprises receiving a read request for an LBA; determining if an invalid logical ID corresponds to the LBA; and generating a record not found condition if the read request is a user request or a host level request, and the invalid logical ID corresponds to the LBA.
According to aspects of the invention, the method further comprises attempting to read the data if at least one of the read request is an internal drive Read ID Intelligently re-try and the LBA contains a valid logical ID.